package com.duoec.dw.lineage.dto;

import com.duoec.dw.lineage.enums.DatabaseTypeEnum;

import java.time.LocalDateTime;
import java.util.LinkedHashSet;

/**
 * @author xuwenzhen
 */
public class TableInfoDto extends TableCoordinateDto {
    /**
     * 表描述
     */
    private String comment;

    /**
     * 字段列表
     */
    private LinkedHashSet<TableFieldDto> fields;

    /**
     * 数据库类型：0=数仓hive库 1=业务mysql库 2=业务mongodb库
     *
     * @see DatabaseTypeEnum
     */
    private Integer databaseType = 0;

    /**
     * 表最近更新时间
     */
    private LocalDateTime dataUpdateLastTime;

    /**
     * 表最近使用时间
     */
    private LocalDateTime lastAccessTime;

    /**
     * 表类型，比如：EXTERNAL_TABLE
     */
    private String tableType;

    /**
     * 表所有者
     */
    private String owner;

    /**
     * 表创建时间
     */
    private LocalDateTime tableCreateTime;

    /**
     * 表路径(HDFS)
     */
    private String location;

    /**
     * 最后修改者
     */
    private String lastModifiedBy;

    /**
     * 最后修改时间
     */
    private LocalDateTime lastModifiedTime;

    /**
     * 表储量,单位Bytes
     *
     * @demo 100
     */
    private Long tableStorageCapacity;

    /**
     * 文件存储格式
     *
     * @demo textFile/sequenceFile/rcFile/orcFile/otherFile
     */
    private String tableFileType;

    /**
     * 表最新分区hdfs文件个数
     *
     * @demo 100
     */
    private Integer latestPartitionFileCount;


    /**
     * 其它表信息
     */
    private String extJson;

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public LinkedHashSet<TableFieldDto> getFields() {
        return fields;
    }

    public void setFields(LinkedHashSet<TableFieldDto> fields) {
        this.fields = fields;
    }

    public Integer getDatabaseType() {
        return databaseType;
    }

    public void setDatabaseType(Integer databaseType) {
        this.databaseType = databaseType;
    }

    public LocalDateTime getDataUpdateLastTime() {
        return dataUpdateLastTime;
    }

    public void setDataUpdateLastTime(LocalDateTime dataUpdateLastTime) {
        this.dataUpdateLastTime = dataUpdateLastTime;
    }

    public LocalDateTime getLastAccessTime() {
        return lastAccessTime;
    }

    public void setLastAccessTime(LocalDateTime lastAccessTime) {
        this.lastAccessTime = lastAccessTime;
    }

    public String getTableType() {
        return tableType;
    }

    public void setTableType(String tableType) {
        this.tableType = tableType;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public LocalDateTime getTableCreateTime() {
        return tableCreateTime;
    }

    public void setTableCreateTime(LocalDateTime tableCreateTime) {
        this.tableCreateTime = tableCreateTime;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public LocalDateTime getLastModifiedTime() {
        return lastModifiedTime;
    }

    public void setLastModifiedTime(LocalDateTime lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
    }

    public Long getTableStorageCapacity() {
        return tableStorageCapacity;
    }

    public void setTableStorageCapacity(Long tableStorageCapacity) {
        this.tableStorageCapacity = tableStorageCapacity;
    }

    public String getTableFileType() {
        return tableFileType;
    }

    public void setTableFileType(String tableFileType) {
        this.tableFileType = tableFileType;
    }

    public Integer getLatestPartitionFileCount() {
        return latestPartitionFileCount;
    }

    public void setLatestPartitionFileCount(Integer latestPartitionFileCount) {
        this.latestPartitionFileCount = latestPartitionFileCount;
    }

    public String getExtJson() {
        return extJson;
    }

    public void setExtJson(String extJson) {
        this.extJson = extJson;
    }

    @Override
    public String toString() {
        return super.toString();
    }


}
